package cn.huolabao.controller;

import cn.huolabao.common.core.utils.R;
import cn.huolabao.model.SysJob;
import cn.huolabao.service.SysJobService;
import cn.huolabao.vo.portal.PageVo;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

@RestController
@RequestMapping("/job")
@RequiredArgsConstructor
@Slf4j
@Api(tags = "岗位管理")
public class JobController {

    private final SysJobService jobService;

    @GetMapping("/list")
    @ApiOperation(value = "获取用户列表", httpMethod = "POST")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "current", value = "当前页", required = true),
            @ApiImplicitParam(name = "pageSize", value = "每页显示的条数", required = true),
            @ApiImplicitParam(name = "jobName", value = "岗位名称"),
            @ApiImplicitParam(name = "descript", value = "岗位描述"),
            @ApiImplicitParam(name = "jobCode", value = "岗位编码"),
    })
    public R list(@ApiIgnore SysJob sysJob, PageVo pageVo) {
        return R.ok(jobService.selectJobList(new Page<>(pageVo.getCurrent(), pageVo.getPageSize()), sysJob));
    }
}
